package cn.yili12.business.vo;

import lombok.Data;

@Data
public class Result {
    public static final int LOGIN = 2;
    public static final int NORMAL = 1;

    private boolean success;
    private String message;
    private Object data;
    private Integer code = 0;

    public Result() {
    }

    public Result(boolean success, String message, Object data, Integer code) {
        this.success = success;
        this.message = message;
        this.data = data;
        this.code = code;
    }

    public static Result fail(String message, Object data) {
        return new Result(false, message, data, 0);
    }

    public static Result fail(String message) {
        return new Result(false, message, null, 0);
    }

    public static Result success(String message, Object data) {
        return new Result(true, message, data, 0);
    }
}
